package jjn.round2;

import commons.TreeNode;

/**
 * @author Jiang Jining
 * @since 2023-05-03 18:50
 */
public class Offer27_MirrorOfBinaryTree {
    public TreeNode mirrorTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode newRight = mirrorTree(root.left);
        TreeNode newLeft = mirrorTree(root.right);
        root.left = newLeft;
        root.right = newRight;
        return root;
    }
}
